"""empty message

Revision ID: 9efbf0a5fd41
Revises: f2f9a97b59c6
Create Date: 2024-05-17 14:21:45.415877

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '9efbf0a5fd41'
down_revision: Union[str, None] = 'f2f9a97b59c6'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('resume_about_us', sa.Column('resume_id', sa.Uuid(), nullable=False))
    op.drop_constraint('resume_about_us_cv_user_id_fkey', 'resume_about_us', type_='foreignkey')
    op.create_foreign_key(None, 'resume_about_us', 'resume', ['resume_id'], ['id'])
    op.drop_column('resume_about_us', 'cv_user_id')
    op.add_column('resume_contact', sa.Column('resume_id', sa.Uuid(), nullable=False))
    op.drop_constraint('resume_contact_cv_user_id_fkey', 'resume_contact', type_='foreignkey')
    op.create_foreign_key(None, 'resume_contact', 'resume', ['resume_id'], ['id'])
    op.drop_column('resume_contact', 'cv_user_id')
    op.add_column('resume_education', sa.Column('resume_id', sa.Uuid(), nullable=False))
    op.drop_constraint('resume_education_cv_user_id_fkey', 'resume_education', type_='foreignkey')
    op.create_foreign_key(None, 'resume_education', 'resume', ['resume_id'], ['id'])
    op.drop_column('resume_education', 'cv_user_id')
    op.add_column('resume_info', sa.Column('resume_id', sa.Uuid(), nullable=False))
    op.drop_constraint('resume_info_cv_user_id_fkey', 'resume_info', type_='foreignkey')
    op.create_foreign_key(None, 'resume_info', 'resume', ['resume_id'], ['id'])
    op.drop_column('resume_info', 'cv_user_id')
    op.add_column('resume_position', sa.Column('resume_id', sa.Uuid(), nullable=False))
    op.drop_constraint('resume_position_cv_user_id_fkey', 'resume_position', type_='foreignkey')
    op.create_foreign_key(None, 'resume_position', 'resume', ['resume_id'], ['id'])
    op.drop_column('resume_position', 'cv_user_id')
    op.add_column('resume_salary', sa.Column('resume_id', sa.Uuid(), nullable=False))
    op.drop_constraint('resume_salary_cv_user_id_fkey', 'resume_salary', type_='foreignkey')
    op.create_foreign_key(None, 'resume_salary', 'resume', ['resume_id'], ['id'])
    op.drop_column('resume_salary', 'cv_user_id')
    op.add_column('resume_skill', sa.Column('resume_id', sa.Uuid(), nullable=False))
    op.drop_constraint('resume_skill_cv_user_id_fkey', 'resume_skill', type_='foreignkey')
    op.create_foreign_key(None, 'resume_skill', 'resume', ['resume_id'], ['id'])
    op.drop_column('resume_skill', 'cv_user_id')
    op.add_column('resume_work', sa.Column('resume_id', sa.Uuid(), nullable=False))
    op.drop_constraint('resume_work_cv_user_id_fkey', 'resume_work', type_='foreignkey')
    op.create_foreign_key(None, 'resume_work', 'resume', ['resume_id'], ['id'])
    op.drop_column('resume_work', 'cv_user_id')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('resume_work', sa.Column('cv_user_id', sa.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'resume_work', type_='foreignkey')
    op.create_foreign_key('resume_work_cv_user_id_fkey', 'resume_work', 'resume', ['cv_user_id'], ['id'])
    op.drop_column('resume_work', 'resume_id')
    op.add_column('resume_skill', sa.Column('cv_user_id', sa.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'resume_skill', type_='foreignkey')
    op.create_foreign_key('resume_skill_cv_user_id_fkey', 'resume_skill', 'resume', ['cv_user_id'], ['id'])
    op.drop_column('resume_skill', 'resume_id')
    op.add_column('resume_salary', sa.Column('cv_user_id', sa.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'resume_salary', type_='foreignkey')
    op.create_foreign_key('resume_salary_cv_user_id_fkey', 'resume_salary', 'resume', ['cv_user_id'], ['id'])
    op.drop_column('resume_salary', 'resume_id')
    op.add_column('resume_position', sa.Column('cv_user_id', sa.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'resume_position', type_='foreignkey')
    op.create_foreign_key('resume_position_cv_user_id_fkey', 'resume_position', 'resume', ['cv_user_id'], ['id'])
    op.drop_column('resume_position', 'resume_id')
    op.add_column('resume_info', sa.Column('cv_user_id', sa.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'resume_info', type_='foreignkey')
    op.create_foreign_key('resume_info_cv_user_id_fkey', 'resume_info', 'resume', ['cv_user_id'], ['id'])
    op.drop_column('resume_info', 'resume_id')
    op.add_column('resume_education', sa.Column('cv_user_id', sa.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'resume_education', type_='foreignkey')
    op.create_foreign_key('resume_education_cv_user_id_fkey', 'resume_education', 'resume', ['cv_user_id'], ['id'])
    op.drop_column('resume_education', 'resume_id')
    op.add_column('resume_contact', sa.Column('cv_user_id', sa.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'resume_contact', type_='foreignkey')
    op.create_foreign_key('resume_contact_cv_user_id_fkey', 'resume_contact', 'resume', ['cv_user_id'], ['id'])
    op.drop_column('resume_contact', 'resume_id')
    op.add_column('resume_about_us', sa.Column('cv_user_id', sa.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'resume_about_us', type_='foreignkey')
    op.create_foreign_key('resume_about_us_cv_user_id_fkey', 'resume_about_us', 'resume', ['cv_user_id'], ['id'])
    op.drop_column('resume_about_us', 'resume_id')
    # ### end Alembic commands ###
